package com.hh.common.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SystemInfoUtils {
    @Autowired
    private RedisUtil redisUtil;

    /**
     * 检测前台系统是否在维护
     * @return
     */
    public boolean checkMaintain(){
        Object remoteCacheIsClose = redisUtil.get("APP_IS_CLOSE");
        if(remoteCacheIsClose != null){
            return true;
        }
        return false;
    }

    /**
     * 检测后台系统是否在维护
     * @return
     */
    public boolean checkBackstageShoutDown(){
        Object shoutDown = redisUtil.get("SYSTEM_BACKSTAGE_IS_SHUTDOWN");
        if(shoutDown != null){
            return true;
        }
        return false;
    }
}
